VFG.Render = function() {
}
/**
 * 底图
 */
VFG.Render.getImageryProvider = function(viewer,options) {
	if('tianditu'==options.thing.provider){
		return new VFG.TiandituImageryProvider(viewer,options);
	}
	else if('custom'==options.thing.provider){
		return new VFG.CommonImageryProvider(viewer,options);
	}
}

VFG.Render.getTModel = function(viewer,options,uri) {
	if(options.thing && options.thing.isRelative=='1' && options.thing.url 
		&& options.thing.url.indexOf('https://')==-1 && options.thing.url.indexOf('http://')==-1){
		options.thing.url=uri+options.thing.url
	}
	return new VFG.TModel(viewer, options)
}

VFG.Render.getPModel = function(viewer,options,uri) {
	if(options.thing && options.thing.isRelative=='1' && options.thing.url 
		&& options.thing.url.indexOf('https://')==-1 && options.thing.url.indexOf('http://')==-1){
		options.thing.url=uri+options.thing.url
	}
	return new VFG.PModel(viewer,options);
}

VFG.Render.getVModel = function(viewer,options,uri) {
	if(options.thing && options.thing.isRelative=='1' && options.thing.url 
		&& options.thing.url.indexOf('https://')==-1 && options.thing.url.indexOf('http://')==-1){
		options.thing.url=uri+options.thing.url;
	}
	if(options.thing && options.thing.isRelative=='1' && options.thing.thumbnail 
		&& options.thing.thumbnail.indexOf('https://')==-1 && options.thing.thumbnail.indexOf('http://')==-1){
		options.thing.thumbnail=uri+options.thing.thumbnail;
	}
	if(options.thing && options.thing.videoRelative=='1' && options.thing.videoType=='0' && options.thing.videoUrl 
		&& options.thing.videoUrl.indexOf('https://')==-1 && options.thing.videoUrl.indexOf('http://')==-1){
		options.thing.videoUrl=uri+options.thing.videoUrl;
	}
	return new VFG.VModel(viewer,options);
}

VFG.Render.getERoadMark = function(viewer,options,uri) {
	if(options && options.thing && options.thing.coordinates && Object.prototype.toString.call(options.thing.coordinates) === "[object String]"){
		var coordinates = options.thing.coordinates;
		options.thing.coordinates=JSON.parse(coordinates);
	}
	return new VFG.ERoadMark(viewer,options);
}

VFG.Render.getPointMark = function(viewer,options,uri) {
	if(options && options.thing  && options.thing.image 
		&& options.thing.image.indexOf('https://')==-1 && options.thing.image.indexOf('http://')==-1){
		options.thing.image=uri+options.thing.image;
	}
	return new VFG.PPoint(viewer,options);
}

VFG.Render.getEPolyline = function(viewer,options,uri) {
	if(options && options.thing && options.thing.positions && Object.prototype.toString.call(options.thing.positions) === "[object String]"){
		var positions = options.thing.positions;
		options.thing.positions=JSON.parse(positions);
	}
	return new VFG.EPolyline(viewer,options);
}



